'use strict';

module.exports = appInfo => {
    const config = exports = {};

    config.middleware = ['weixin']
    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + '_wx-server';

    // add your config here
    config.middleware = [];

    config.weixin = {
        token: 'foolishchow',
        appid: 'wxbb207a8075cb8f12',
        encodingAESKey: 'KW685Un1ebsK2z63n3JL8q3WUVK9yxbVGDCkXjnppkN',
        checkSignature: true
    }
    config.logger = {
        consoleLevel: 'DEBUG',
        level: 'NONE'
    };

    config.security = {
        csrf: {
            // 判断是否需要 ignore 的方法，请求上下文 context 作为第一个参数
            ignore: ctx => {
                // console.info(ctx.ip)
                return true; //ctx.ip.toString().startsWith('192.')
            },
        },
    }
    return config;
};